/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"321AE4D3-8DF0-4C76-9C35-F27CC41982D0"}
 */
var fPassViejo = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"19B9A0EB-6E52-4962-9E38-8E06E8AC0798"}
 */
var fPass2 = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"0AD1ADAF-F204-4F11-AF18-831D10162237"}
 */
var fPass = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"A5804B05-6220-414A-9B23-5F8D1A9C9EA1"}
 */
function cambiarContraseña(event) {
	var $hash = usuario_id.toString() + fPassViejo
	if (utils.validatePBKDF2Hash($hash, hash_pass))
	{
		if (fPass == fPass2)
		{
			hash_pass = utils.stringPBKDF2Hash(usuario_id.toString() + fPass)
			databaseManager.saveData(foundset)
			globals.show('home')
		}
		else
		{
			globals.DIALOGS.showWarningDialog(i18n.getI18NMessage('hoteleria.aviso'),i18n.getI18NMessage('hoteleria.aviso.contraseñasDistintas'),'OK')
		}
	}
	else
	{
		globals.DIALOGS.showWarningDialog(i18n.getI18NMessage('hoteleria.aviso'),i18n.getI18NMessage('hoteleria.aviso.contraseñaActualDistinta'),'OK')
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"575D986F-D8B0-499E-80FF-54A8822F0423"}
 */
function guardarCambios(event) {
	databaseManager.saveData(foundset)
	globals.show('home')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"722604DB-F6DC-4657-A109-A14511A41765"}
 */
function mostrarCalendario(event) {
	var $fDesde = new Date(1900, 0,1, 0,0,0,0)
	var $fHasta = new Date(globals.gHoy.getFullYear(), globals.gHoy.getMonth(), globals.gHoy.getDate(), 0,0,0,0)
	var $form = globals.mostrarCalendarioMes(1, 1980, $fDesde, $fHasta, 'POPUP', null, gcadena_to_cadenas.estilo)
	plugins.window.showFormPopup(elements.fld_fecha,forms[$form],foundset.getRecord(foundset.getSelectedIndex()),'fecha_nacimiento')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"7F5BF018-C3B8-401C-BA06-84E1CCA3E292"}
 */
function iraMisReservas(event) {
	forms.mis_reservas.controller.show()
}
